package com.gr.experimental.model.impl;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.gr.experimental.model.MFrag;
import com.gr.experimental.model.Node;
import com.gr.experimental.model.ResidentNode;

/**
 * Class describing an mfrag.
 * 
 * This is still an experimental version.  It is rather an
 * internal class of the reasoner, with proper helper 
 * fields, than a class used by the user.
 * @author Karol Banczyk
 *
 */
class MFragImpl implements MFrag {

	private String name;

	private List<Node> contextNodes;
	private List<Node> inputNodes;
	private List<ResidentNode> residentNodes;


	/**
	 * @param name
	 * @param contextNodes
	 * @param inputNodes
	 * @param residentNodes
	 */
	public MFragImpl(String name, List<Node> contextNodes,
			List<Node> inputNodes, List<ResidentNode> residentNodes) {
		super();
		this.name = name;
		this.contextNodes = new ArrayList<Node>(contextNodes);
		this.inputNodes = new ArrayList<Node>(inputNodes);
		this.residentNodes = new ArrayList<ResidentNode>(residentNodes);
	}
	

	/**
	 * {@inheritDoc}
	 * @see com.gr.experimental.model.MFrag#getName()
	 */
	public String getName() {
		return this.name;
	}


	/**
	 * {@inheritDoc}
	 * @see com.gr.experimental.model.MFrag#getContextNodes()
	 */
	public List<Node> getContextNodes() {
		return Collections.unmodifiableList(this.contextNodes);
	}


	/**
	 * {@inheritDoc}
	 * @see com.gr.experimental.model.MFrag#getInputNodes()
	 */
	public List<Node> getInputNodes() {
		return Collections.unmodifiableList(this.inputNodes);
	}


	/**
	 * {@inheritDoc}
	 * @see com.gr.experimental.model.MFrag#getResidentNodes()
	 */
	public List<ResidentNode> getResidentNodes() {
		return Collections.unmodifiableList(this.residentNodes);
	}

	
}
